/**
 * Created by fangshufeng on 2017/7/17.
 */


import  React,{PureComponent} from 'react';
import {
    FlatList,
    Text
} from  'react-native'


export  default  class  TestFlatView extends  PureComponent {

    _keyExtractor = (item, index) => item.id;

    render() {
        return (
            <FlatList
                data={[{name: 'a', id: 0}, {name: 'b', id: 1}]}
                renderItem={({item}) => <Text >{item.name}</Text>}
                keyExtractor={this._keyExtractor}
            />
        );
    }

    componentDidMount() {
        this._getHomePage();
        this._testCode();
    }

    _getHomePage = () => {
       return fetch('https://m.stb.nonobank.com/msapi/dataBase/getHomePage',{
            body:JSON.stringify(
                {
                    'terminal':'4',
                    'version':'5.3.2',
                }
            ),
           method:'POST'
        })
           .then((respones) => respones.json())
           .then((respensJson) => {
                    console.log(respensJson);
           })
           .catch((error) => {
               console.log('error----'+ error);
           });

    }


    _testCode = () => {


    }

}


